package org.ume.school.modules.model;

import java.util.HashMap;
import java.util.Random;

/**
 * Created by Django on 2017/8/11.
 */
public class HeadDefEnum {

    private static HashMap<String, String> defPerson = new HashMap<>();

    private static String DEF_DIC = "/headimages/default";

    static {

        defPerson.put("1", "王娡");
        defPerson.put("2", "赵飞燕");
        defPerson.put("3", "陈圆圆");
        defPerson.put("4", "琴操");
        defPerson.put("5", "鱼玄机");
        defPerson.put("6", "王羲之");
        defPerson.put("7", "杜甫");
        defPerson.put("8", "唐伯虎");
        defPerson.put("9", "郭沫若");
        defPerson.put("10", "辛弃疾");
        defPerson.put("0", "鲁迅");
    }

    public static String[] getRandom() {
        String[] vs = {"0", String.format("%s/%d.jpg", DEF_DIC, 0)};
        Random random = new Random();
        int result = random.nextInt(10);
        if (result <= 10 && result > 0) {
            vs[0] = defPerson.get(String.valueOf(result));
            vs[1] = String.format("%s/%d.jpg", DEF_DIC, result);
        }
        return vs;
    }
}
